package com.jmb.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;


import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName t_task
 */
@TableName(value ="t_task")
@Data
public class Task extends BaseEntity {


    /**
     * 名称
     */
    @Schema(description = "名称")
    @NotEmpty(message = "任务名称不能为空")
    @Size(max = 200, message = "任务名称长度需小于等于200")
    @TableField(value = "description")
    private String description;

    /**
     * 定时任务表达式
     */
    @Schema(description = "定时任务表达式")
    @NotEmpty(message = "cron表达式不能为空")
    @Size(max = 30, message = "cron表达式长度需小于等于30")
    @TableField(value = "cron")
    private String cron;

    /**
     * 下次执行时间
     */
    @Schema(description = "下次执行时间")
    @TableField(value = "next_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date nextTime;


    /**
     * 0接口1UI
     */
    @Schema(description = "0接口 1UI")
    @TableField(value = "suite_type")
    private Integer suiteType;

    /**
     * 测试套件编号
     */
    @Schema(description = "测试套件编号")
    @NotNull(message = "测试套件不能为空")
    @TableField(value = "suite_id")
    private Integer suiteId;

    /**
     * 状态0启用1禁用
     */
    @Schema(description = "状态 0启用1禁用")
    @TableField(value = "status")
    private Integer status;
}